module samples.io.console;

import dotmars.io.console;
import dotmars.text.utf;
import dotmars.base.time;

void main()
{
	class Foo {
		override char[] toString() {
			return "Greeting!";
		}
	}
	
	//这简直就是 C# 嘛
	TimeSpan span = TimeSpan(12, 30, 15);
	auto foo = new Foo;

	Console.writeLine("Hello World!");
	Console.writeLine(span);
	Console.writeLine(foo);
	Console.printLine("Format object:	{0}", foo);
	Console.printLine("Format float:	PI={0:D4}", 3.1415926);
	Console.printLine("Format float2:	x={0:E4}", 123456789.54321);
	Console.printLine("String & Integers: {2} {{0x{0:X8}} {1}", 0xffff, 123456, "Console");
	Console.printLine("Aligned String: =={0, 10}==", "DotMars");
	Console.writeLine(1234567);

	wchar[] str = "中文支持也没问题"w;
	Console.printLine("{0}", str);

	Console.writeLine(str.toUtf8());
}
